home *** CD-ROM | disk | FTP | other *** search
- /* $Header: C:/SRC/MOUSE/PVCS/MOUSE.H_V 1.0 12 Jun 1989 21:29:08 $
- Dwight N. Tovey (Adapted from the May/June 1988 issue of TURBO TECHNIX)
- ----------------------------------------------------------------------------
-
- $Log: C:/SRC/MOUSE/PVCS/MOUSE.H_V $
-
- Rev 1.0 12 Jun 1989 21:29:08
- Initial revision.
- */
-
- #ifndef MOUSE_H
- #define MOUSE_H
-
- #include <dos.h>
-
- /* Define sorting macros used locally */
- #define lower( x, y ) (x < y) ? x : y
- #define upper( x, y ) (x > y) ? x : y
-
- /* BUTTON DEFINITIONS */
- #ifndef LEFT
- #define LEFT 0
- #define RIGHT 1
- #endif
-
- /* STRUCTURES USED BY THE MOUSE FUNCTIONS. */
- typedef struct {
- int exists, /* TRUE if mouse is present */
- nButtons; /* # of buttons on mouse */
- } resetRec; /* returned by mReset */
-
- typedef struct {
- int buttonStatus, /* bits 0-2 on if corresp button is down */
- opCount, /* # times button has been clicked */
- column, row; /* position */
- } LocRec; /* returned by mPos, mPressed, mReleased. */
-
- typedef struct {
- int hCount, /* Net horizontal movement. */
- vCount; /* Net vertical movement. */
- } moveRec; /* Returned by mMotion */
- /*-------------------------------------------------------------------------*/
-
- /* Prototypes for the MS mouse functions. */
-
- resetRec *m_reset( void );
- /* Resets mouse to default state. Returns pointer to a structure
- indicating whether or not mouse is installed and, if so, how many
- buttons it has.
- Always call this function during program initialization. */
-
- void m_show( void );
- /* Makes the mouse cursor visible. Don't call if cursor is already
- visible, and alternate with calls to mHide. */
-
- void m_hide( void );
- /* Makes mouse cursor invisible. Movement and button activity are stil
- tracked. Do not call if cursor is already hidden, and alternate with
- calls to mShow. */
-
- LocRec *m_pos( void );
- /* Gets mouse cursor position and button status, returns pointer to
- structure containing this info. */
-
- void m_moveto( int, int );
- /* Move mouse cursor to new position. */
-
- LocRec *m_pressed( int );
- /* Gets pressed info about named button: current status (up/down), times
- pressed since last call, position at most recent press. Resets count
- and position info. Button 0 is left, 1 is right.
- Returns pointer to LocRec structure containing info. */
-
- LocRec *m_released( int );
- /* Same as mPressed, except gets released info about button. */
-
- void m_col_range( int, int );
- /* Sets min and max horizontal range for mouse cursor. Moves cursor
- inside range if outside when called. Swaps values if hmin and hmax
- are reversed. */
-
- void m_row_range( int, int );
- /* Same as mColRange, except sets vertical boundaries. */
-
- void m_graph_cursor( int, int, unsigned, unsigned );
- /* Sets graphic cursor shape. */
-
- void m_text_cursor( int, unsigned, unsigned );
- /* Sets text cursor type, where 0 = software and 1 = hardware).
- For software cursor, the two unsigned args are the screen and cursor
- masks.
- For hardware cursor, the two unsigned args specify scan line
- start/stop i.e cursor shape. */
-
- moveRec *m_motion( void );
- /* Reports net motion of cursor since last call to this function. */
-
- void m_inst_task( unsigned mask, unsigned taskSeg, unsigned taskOfs );
- /* Installs a user-defined task to be executed upon one or more mouse
- events specified by mask. */
-
- void m_lpen_on( void );
- /* Turns on light pen emulation. This is the default condition. */
-
- void m_lpen_off( void );
- /* Turns off light pen emulation. */
-
- void m_ratio( int, int );
- /* Sets mickey-to-pixel ratio, where ratio is R/8. Default is 16 for
- vertical, 8 for horizontal. */
-
- #endif /* MOUSE_H */
-
-